"""LczWeb URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from View import index
from View.My import a


#在 URLconf 中使用 register_converter() 来注册自定义的转换器类：需要导入 register_converter
from django.urls import register_converter
from . import MyConverter
register_converter(MyConverter.FourDigitYearConverter,'yyyy')#注册FourDigitYearConverter 名称为 yyyy
register_converter(MyConverter.FourDigitMonthConverter,'MM')#注册FourDigitYearConverter 名称为 MM 匹配月份的 正则没有生效 不知道为什么
urlpatterns = [
    path('', index.index),
    path('my/',a.current_datetime),
    path('my/imginfo/',a.imginfo),  
    path('my/<yyyy:int>/',a.v_yyyy),   
    path('my/<int:int>/',a.v_int),   
    path('my/<yyyy:year>/<int:month>/',a.v_int_int),
    path('my/<slug:slug>/',a.v_slug),
    path('my/<path:path>/',a.v_path),
    path('my/<str:str>/',a.v_str),
]
handler404 = index.page_not_found
handler500 = index.page_error